package com.yanqu.road.server.cmd.activity.climbtower;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.ClimbTowerProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.climbtower.ClimbTowerModule;
import com.yanqu.road.server.manger.activity.ActivityMgr;
import com.yanqu.road.server.manger.activity.climbtower.ClimbTowerMgr;
import com.yanqu.road.server.protocol.GameErrorCode;
import com.yanqu.road.server.protocol.Protocol;


@Cmd(code = Protocol.S_CLIMB_TOWER_TOP_CELL_CHANGE_CROSS_RESP, desc = "//新幻境游戏服层数更新")
public class ClimbTowerTopCellChangeCrossCmd extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        // 没有活动
        if (!ActivityMgr.activityInShowTime(ClimbTowerMgr.getActivityInfo()) || ClimbTowerMgr.getConfig() == null) {
            ret = GameErrorCode.E_ACTIVITY_OVER_TIME;
            return;
        }
        ClimbTowerProto.ClimbTowerCrossUpdateTopCellRespMsg reqMsg = ClimbTowerProto.ClimbTowerCrossUpdateTopCellRespMsg.parseFrom(packet.getBytes());
        player.getModule(ClimbTowerModule.class).getUserData().setTopCellNum(reqMsg.getTopCellNum());
    }

    @Override
    public void sendData(GamePlayer player) {
    }
}
